//
//  AttentionDetailCell.m
//  PropertyMananger
//
//  Created by bh on 16/12/30.
//  Copyright © 2016年 BH. All rights reserved.
//

#import "AttentionDetailCell.h"

@implementation AttentionDetailCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *cellID = @"AttentionDetailCellID";
    AttentionDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if(cell == nil) {
        cell = [[AttentionDetailCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    //选中cell的颜色 -无色
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return cell;

}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{

    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        static CGFloat cellH = 100;
        self.titleLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.titleLabel];
     //   self.titleLabel.text = @"手机号:";
      //  phoneNumLabel.backgroundColor  = BHRandColor;
        
        self.titleLabel.textColor = BHColor(102, 102, 102);
        self.titleLabel.textAlignment = NSTextAlignmentLeft;
        self.titleLabel.font = BHFont(15);
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self).with.offset(15);
            make.centerY.equalTo(self).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(60, 25));
        }];
        
        self.phoneNum = [[UILabel alloc]init];
        [self.contentView addSubview:self.phoneNum];
     //   self.phoneNum.text = @"12345678900";
        self.phoneNum.textAlignment = NSTextAlignmentLeft;
      //  self.phoneNum.backgroundColor = BHRandColor;
        
        self.phoneNum.textColor = BHColor(102, 102, 102);
        self.phoneNum.textAlignment = NSTextAlignmentLeft;
        self.phoneNum.font = BHFont(15);
        
        [self.phoneNum mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self.titleLabel.mas_trailing).with.offset(0);
            make.centerY.equalTo(self).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(120, 25));
        }];
        
        //phoneButton
        self.phoneButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.contentView addSubview:self.phoneButton];
        
        [self.phoneButton setImage:IMG(@"ico_dial_telephone") forState:UIControlStateNormal];
        [self.phoneButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.trailing.equalTo(self).with.offset(-20);
            make.centerY.equalTo(self).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(30, 30));
        }];

    }
    return self;
}
@end
